<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <p:dialog id="dlgCadastro"
              widgetVar="dlg"
              modal="true"
              header="Formulário">
        <h:form id="formDialog">
            <br/>

            <h:inputHidden id="id" value="#{servicoBean.servico.id}"/>
            
            <p:panelGrid columns="2">
                <h:outputText id="outServico" value="Serviço: "/>
                <p:inputText id="txServico"
                             value="#{servicoBean.servico.nome}"
                             label="Serviço"
                             required="true"/>
            </p:panelGrid>
            <p>
                <p:commandButton id="cbSalvar"
                                 value="Salvar"
                                 update=":formServico"
                                 actionListener="#{servicoBean.salvar()}"
                                 oncomplete="PF('dlg').hide()"/>
            </p>
        </h:form>
    </p:dialog>
</html>

